//
//  AnimeViewController.m
//  动漫之家
//
//  Created by 王少泽 on 16/12/1.
//  Copyright © 2016年 王少泽. All rights reserved.
//

#import "AnimeViewController.h"
//导入四个主页面的头文件
#import "ViewController.h"
#import "lightNovelViewController.h"
#import "AnimeNewsViewController.h"
#import "PersonViewController.h"
//引入自定义的导航界面
#import "ComicCusttomController.h"

#import "UpDateViewController.h"
#import "ClassificationViewController.h"
#import "RankViewController.h"
#import "SpecialViewController.h"

#import "ZTViewController.h"

@interface AnimeViewController ()

@end

@implementation AnimeViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    sleep(5);
    // Do any additional setup after loading the view.
    //设置tabbar的按钮
    UITabBarItem* comicView = [[UITabBarItem alloc]initWithTitle:@"漫画" image:[UIImage imageNamed:@"comicIcon"] tag:1001];
    UITabBarItem* newsView = [[UITabBarItem alloc]initWithTitle:@"新闻" image:[UIImage imageNamed:@"NewsIcon"] tag:1002];
    UITabBarItem* lightView = [[UITabBarItem alloc]initWithTitle:@"轻小说" image:[UIImage imageNamed:@"BookIcon"] tag:1003];
    UITabBarItem* personView = [[UITabBarItem alloc]initWithTitle:@"我的" image:[UIImage imageNamed:@"PersonalIcon"] tag:1004];
    
   
    //初始化四个页面的引导文件
    
    
//    ViewController* comicVC = [[ViewController alloc]init];
    AnimeNewsViewController* newsVC = [[AnimeNewsViewController alloc]init];
    lightNovelViewController* novelVC = [[lightNovelViewController alloc]init];
    PersonViewController* mineVC = [[PersonViewController alloc]init];
    
    
    NSArray* titleArr = @[@"推荐",@"更新",@"分类",@"最近",@"查询"];
    Class vc1 = [ViewController class];
    Class vc2 = [UpDateViewController class];
    Class vc3 = [ClassificationViewController class];
    Class vc4 = [RankViewController class];
    Class vc5 = [SpecialViewController class];
    
    NSArray* pageVC = @[vc1,vc2,vc3,vc4,vc5];
    
    ZTViewController* topPage = [[ZTViewController alloc]initWithMneuViewStyle:MenuViewStyleLine];
    [topPage loadVC:pageVC AndTitle:titleArr];
    
    
    
    //创建导航器
    ComicCusttomController* comicBar = [[ComicCusttomController alloc]initWithRootViewController:topPage];
    UINavigationController* newsBar = [[UINavigationController alloc]initWithRootViewController:newsVC];
    UINavigationController* novelBar = [[UINavigationController alloc]initWithRootViewController:novelVC];
    UINavigationController* personBar = [[UINavigationController alloc]initWithRootViewController:mineVC];
    
    //将各个设置出来的tabbarItem进行关联
    comicBar.tabBarItem = comicView;
    newsBar.tabBarItem = newsView;
    novelBar.tabBarItem = lightView;
    personBar.tabBarItem = personView;
    comicBar.navigationBarHidden = YES;
    
    self.viewControllers = @[comicBar,newsBar,novelBar,personBar];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
